<!DOCTYPE html>
<html lang="en">
<head>
    <include file="Public:header2" />
    <title>{:C('web_title')}</title>
    <script type="text/javascript" src="__PUBLIC__/Home/js/cityselect.js"></script>
</head>
<body class="blackbg">
    <div id="container" class="logbg">
        <div class="log_title">
            <span class="back"><a href="javascript:history.go(-1)"></a></span>
            修改交易密码输入设置
        </div>
        <div class="logbot" style="margin-top: 10px;">
            <form>
                <li><label for="only" style="font-size:16px;line-height:24px;color:#ff8800;padding-left:10px;"><input type="radio" value="1" name="tpwdsetting"
                  <eq name="user['tpwdsetting']" value="1">checked="checked"</eq> > 每次登录只输入一次交易密码 </label></li>
                 <li><label for="every" style="font-size:16px;line-height:24px;color:#ff8800;padding-left:10px;"><input type="radio" value="2" name="tpwdsetting"
                  <eq name="user['tpwdsetting']" value="2">checked="checked"</eq> > 每笔交易都输入交易密码</label></li>
                 <li><label for="none" style="font-size:16px;line-height:24px;color:#ff8800;padding-left:10px;"><input id="tpwdsetting" type="radio" value="3" name="tpwdsetting"
                  <eq name="user['tpwdsetting']" value="3">checked="checked"</eq> > 每次交易都不需要输入交易密码</label></li>
                <input  name="name" id="paypassword" type="password" class="logipt" placeholder="交易密码">
                <a href="{:U('Login/findpaypwd')}" class="reg_floatr" style="color:#ff8800;font-size: 14px;line-height: 20px;">忘记密码?</a>
                <input type="button" class="logbut" value="立即添加" name="index_submit" id="loginSubmin" onclick="Update()">
            </form>
        </div>
    </div>
    <include file="Public:footer" />
<script>
    function Update(){
        var paypassword=$("#paypassword").val();
        var tpwdsetting=$("input[name='tpwdsetting']:checked").val();
        if(paypassword==""||paypassword==null){
            layer.tips('请输入交易密码','#paypassword',{tips : 3 });
            return false;
        }
        if(tpwdsetting==""||tpwdsetting==null){
            layer.tips('请输入选择一个','#tpwdsetting',{tips : 3 });
            return false;
        }

        $.post("{:U('User/uptpwdsetting')}",{paypassword : paypassword,tpwdsetting : tpwdsetting },function(data){
            if(data.status==1){
                layer.msg(data.info,{icon : 1 });
                window.location="{:U('User/tpwdset')}";
            }else{
                layer.msg(data.info,{icon : 2 });
                if(data.url){
                    window.location=data.url;
                }
            }
        },"json");
    }
</script>
</body>
</html>